package com.xxx.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum MenuStatusEnum {

    ENABLE(0, "正常"),
    STOP(1, "停用"),
    ;

    /*** 字典编码 */
    private final Integer code;
    /*** 字典值 */
    private final String value;

    public static MenuStatusEnum getByCode(Integer param) {
        for (MenuStatusEnum status : MenuStatusEnum.values()) {
            if (status.getCode().equals(param)) {
                return status;
            }
        }
        throw new IllegalArgumentException("No matching Enum for : " + param);
    }

}
